package com.aspose.cells;

import java.util.HashMap;

public class ConditionalFormattingIcon {
   private int c;
   private int d;
   private byte[] e;
   static HashMap a = null;
   static com.aspose.cells.a.f.zi b = null;

   ConditionalFormattingIcon(int type, int index) {
      this.c = type;
      this.d = index;
   }

   ConditionalFormattingIcon() {
   }

   void a(ConditionalFormattingIcon var1) {
      this.c = var1.c;
      this.d = var1.d;
   }

   public static byte[] getIconImageData(int type, int index) throws Exception {
      Object var2 = null;
      if (b == null) {
         b = com.aspose.cells.a.f.zi.a(com.aspose.cells.a.c.zy.a("Aspose.Cells.StyleObject.ConditionStyle.IconImages.zip"));
         a = new HashMap();
      }

      if (type == 20) {
         return null;
      } else {
         byte[] var3 = a(type, index);
         return var3;
      }
   }

   public byte[] getImageData() throws Exception {
      if (b == null) {
         b = com.aspose.cells.a.f.zi.a(com.aspose.cells.a.c.zy.a("Aspose.Cells.StyleObject.ConditionStyle.IconImages.zip"));
         a = new HashMap();
      }

      if (this.c == 20) {
         return null;
      } else {
         this.e = a(this.c, this.d);
         return this.e;
      }
   }

   public int getType() {
      return this.c;
   }

   public void setType(int value) {
      this.c = value;
   }

   public int getIndex() {
      return this.d;
   }

   public void setIndex(int value) {
      this.d = value;
   }

   private static com.aspose.cells.b.a.b.zj a(int var0) throws Exception {
      com.aspose.cells.b.a.b.zj var1 = (com.aspose.cells.b.a.b.zj)a.get(var0);
      HashMap var2 = a;
      synchronized(a) {
         if (var1 == null) {
            com.aspose.cells.a.f.zh var3 = b.a(zsl.c(var0) + ".png");
            com.aspose.cells.b.a.d.za var4 = new com.aspose.cells.b.a.d.za(b.a(var3));
            byte[] var5 = new byte[(int)var3.a()];
            var4.a(var5, 0, var5.length);
            var4.l();
            com.aspose.cells.b.a.d.zh var6 = new com.aspose.cells.b.a.d.zh(var5);
            var1 = com.aspose.cells.b.a.b.za.a(var6);
            a.put(var0, var1);
         }

         return var1;
      }
   }

   private static byte[] a(int var0, int var1) throws Exception {
      com.aspose.cells.b.a.b.zj var2 = a(var0);
      com.aspose.cells.b.a.b.za var3 = new com.aspose.cells.b.a.b.za(16, 16);
      com.aspose.cells.b.a.b.zi var4 = com.aspose.cells.b.a.b.zi.a((com.aspose.cells.b.a.b.zj)var3);
      var4.a(var2, (com.aspose.cells.b.a.b.zp)(new com.aspose.cells.b.a.b.zp(0, 0, 16, 16)), (com.aspose.cells.b.a.b.zp)(new com.aspose.cells.b.a.b.zp(0, var1 * 24, 16, 16)), 2);
      var4.e();
      com.aspose.cells.b.a.d.zh var5 = new com.aspose.cells.b.a.d.zh();
      var3.a(var5, ImageFormat.getPng());
      byte[] var6 = var5.o();
      return var6;
   }
}
